﻿<?xml version="1.0" encoding="utf-8"?>

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Title">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="ID" type="xs:unsignedByte" />
                <xs:element name="WebServiceID" type="xs:string" />
                <xs:element name="TVWebServiceID" />
                <xs:element name="CollectionNumber" type="xs:unsignedByte" />
                <xs:element name="MediaType" />
                <xs:element name="Type">
                    <xs:complexType>
                        <xs:simpleContent>
                            <xs:extension base="xs:string">
                                <xs:attribute name="BluRay3D" type="xs:string" use="required" />
                                <xs:attribute name="BoxSet" type="xs:string" use="required" />
                            </xs:extension>
                        </xs:simpleContent>
                    </xs:complexType>
                </xs:element>
                <xs:element name="Barcode" type="xs:unsignedLong" />
                <xs:element name="Country" type="xs:string" />
                <xs:element name="LocalTitle" type="xs:string" />
                <xs:element name="LocalTitleDisplay" type="xs:string" />
                <xs:element name="OriginalTitle" type="xs:string" />
                <xs:element name="SortTitle" type="xs:string" />
                <xs:element name="SortTitleDisplay" type="xs:string" />
                <xs:element name="Edition" />
                <xs:element name="IMDB" type="xs:string" />
                <xs:element name="Rating" type="xs:unsignedByte" />
                <xs:element name="AspectRatio" type="xs:string" />
                <xs:element name="VideoStandard" type="xs:string" />
                <xs:element name="ProductionYear" type="xs:unsignedShort" />
                <xs:element name="ReleaseDate" type="xs:string" />
                <xs:element name="ReleaseDateDisplay" type="xs:string" />
                <xs:element name="RunningTime" type="xs:unsignedByte" />
                <xs:element name="TagLine" />
                <xs:element name="Description" type="xs:string" />
                <xs:element name="ExtraFeatures">
                    <xs:complexType>
                        <xs:simpleContent>
                            <xs:extension base="xs:string">
                                <xs:attribute name="NotPresent" type="xs:string" use="required" />
                            </xs:extension>
                        </xs:simpleContent>
                    </xs:complexType>
                </xs:element>
                <xs:element name="ParentalRating">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="Value" type="xs:unsignedByte" />
                            <xs:element name="Description" />
                        </xs:sequence>
                        <xs:attribute name="Adult" type="xs:string" use="required" />
                        <xs:attribute name="TV" type="xs:string" use="required" />
                    </xs:complexType>
                </xs:element>
                <xs:element name="DataProvider" />
                <xs:element name="DataProviderId" />
                <xs:element name="ImportSource" />
                <xs:element name="ImportId" />
                <xs:element name="LocalTrailer">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="URL" />
                            <xs:element name="Type" type="xs:unsignedByte" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="Watched" type="xs:string" />
                <xs:element name="Covers">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="Front" type="xs:string" />
                            <xs:element name="FrontMedium" type="xs:string" />
                            <xs:element name="Back" type="xs:string" />
                            <xs:element name="BackMedium" type="xs:string" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="DataChanged" type="xs:string" />
                <xs:element name="CoversChanged" type="xs:string" />
                <xs:element name="LockData" type="xs:string" />
                <xs:element name="LockCovers" type="xs:string" />
                <xs:element name="Added" type="xs:string" />
                <xs:element name="RecordChanged" type="xs:string" />
                <xs:element name="Categories" />
                <xs:element name="Genres">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" name="Genre" type="xs:string" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="AudioTracks">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" name="AudioTrack">
                                <xs:complexType>
                                    <xs:attribute name="Language" type="xs:string" use="required" />
                                    <xs:attribute name="Type" type="xs:string" use="required" />
                                    <xs:attribute name="Channels" type="xs:decimal" use="required" />
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="Subtitles">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" name="Subtitle">
                                <xs:complexType>
                                    <xs:attribute name="Language" type="xs:string" use="required" />
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute name="NotPresent" type="xs:string" use="required" />
                    </xs:complexType>
                </xs:element>
                <xs:element name="Studios">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" name="Studio" type="xs:string" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="Discs">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="Disc">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="DiscIdStored" />
                                        <xs:element name="DoubleSided" type="xs:string" />
                                        <xs:element name="Name" type="xs:string" />
                                        <xs:element name="DiscIdSideA" type="xs:string" />
                                        <xs:element name="DiscIdSideB" />
                                        <xs:element name="LocationSideA" type="xs:string" />
                                        <xs:element name="LocationTypeSideA" type="xs:unsignedByte" />
                                        <xs:element name="LocationSideB" />
                                        <xs:element name="LocationTypeSideB" type="xs:byte" />
                                        <xs:element name="ChangerSlot" />
                                        <xs:element name="TitlesSideA">
                                            <xs:complexType>
                                                <xs:sequence>
                                                    <xs:element maxOccurs="unbounded" name="Title">
                                                        <xs:complexType>
                                                            <xs:sequence>
                                                                <xs:element name="Title" type="xs:string" />
                                                                <xs:element maxOccurs="unbounded" name="Chapter">
                                                                    <xs:complexType>
                                                                        <xs:sequence>
                                                                            <xs:element name="Title" type="xs:string" />
                                                                        </xs:sequence>
                                                                        <xs:attribute name="ContainsEpisode"
                                                                                      type="xs:string" use="required" />
                                                                        <xs:attribute name="Number"
                                                                                      type="xs:unsignedByte" use="required" />
                                                                        <xs:attribute name="Hours"
                                                                                      type="xs:unsignedByte" use="required" />
                                                                        <xs:attribute name="Minutes"
                                                                                      type="xs:unsignedByte" use="required" />
                                                                        <xs:attribute name="Seconds"
                                                                                      type="xs:unsignedByte" use="required" />
                                                                        <xs:attribute name="Frames"
                                                                                      type="xs:unsignedByte" use="required" />
                                                                        <xs:attribute name="FPS" type="xs:unsignedByte"
                                                                                      use="required" />
                                                                        <xs:attribute name="TVSeason" type="xs:string"
                                                                                      use="required" />
                                                                        <xs:attribute name="TVEpisode" type="xs:string"
                                                                                      use="required" />
                                                                    </xs:complexType>
                                                                </xs:element>
                                                            </xs:sequence>
                                                            <xs:attribute name="ContainsEpisode" type="xs:string"
                                                                          use="required" />
                                                            <xs:attribute name="MainMovie" type="xs:string"
                                                                          use="required" />
                                                            <xs:attribute name="Number" type="xs:unsignedByte"
                                                                          use="required" />
                                                            <xs:attribute name="Hours" type="xs:unsignedByte"
                                                                          use="required" />
                                                            <xs:attribute name="Minutes" type="xs:unsignedByte"
                                                                          use="required" />
                                                            <xs:attribute name="Seconds" type="xs:unsignedByte"
                                                                          use="required" />
                                                            <xs:attribute name="Frames" type="xs:unsignedByte"
                                                                          use="required" />
                                                            <xs:attribute name="FPS" type="xs:unsignedByte"
                                                                          use="required" />
                                                            <xs:attribute name="TVSeason" type="xs:string"
                                                                          use="required" />
                                                            <xs:attribute name="TVEpisode" type="xs:string"
                                                                          use="required" />
                                                        </xs:complexType>
                                                    </xs:element>
                                                </xs:sequence>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                    <xs:attribute name="TitleMode" type="xs:string" use="required" />
                                    <xs:attribute name="HideSideA" type="xs:string" use="required" />
                                    <xs:attribute name="HideSideB" type="xs:string" use="required" />
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="Persons">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" name="Person">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="Name" type="xs:string" />
                                        <xs:element name="Type" type="xs:string" />
                                        <xs:element name="Role" type="xs:string" />
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="CheckSum" type="xs:string" />
                <xs:element name="MediaInfo">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="VideoDetails">
                                <xs:complexType>
                                    <xs:attribute name="FileType" type="xs:string" use="required" />
                                    <xs:attribute name="Format" type="xs:string" use="required" />
                                    <xs:attribute name="FPS" type="xs:decimal" use="required" />
                                    <xs:attribute name="Codec" type="xs:string" use="required" />
                                    <xs:attribute name="ScanType" type="xs:string" use="required" />
                                    <xs:attribute name="AspectRatio" type="xs:decimal" use="required" />
                                    <xs:attribute name="Width" type="xs:unsignedShort" use="required" />
                                    <xs:attribute name="Height" type="xs:unsignedShort" use="required" />
                                    <xs:attribute name="PlayTime" type="xs:unsignedInt" use="required" />
                                    <xs:attribute name="BitRate" type="xs:unsignedInt" use="required" />
                                </xs:complexType>
                            </xs:element>
                            <xs:element maxOccurs="unbounded" name="Audio">
                                <xs:complexType>
                                    <xs:attribute name="Codec" type="xs:string" use="required" />
                                    <xs:attribute name="Format" type="xs:string" use="required" />
                                    <xs:attribute name="Language" type="xs:string" use="required" />
                                    <xs:attribute name="Channels" type="xs:unsignedByte" use="required" />
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="TMDbId" type="xs:unsignedShort" />
                <xs:element name="IMDbId" type="xs:string" />
                <xs:element name="MPAARating" type="xs:string" />
                <xs:element name="Budget" type="xs:unsignedByte" />
                <xs:element name="Revenue" type="xs:unsignedByte" />
                <xs:element name="IMDBrating" type="xs:decimal" />
                <xs:element name="Language" type="xs:string" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>